<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04.真实节点频繁操作对性能的影响</title>
</head>
<body>
    <h1>04.真实节点频繁操作对性能的影响</h1>
    <div class="num">0</div>
    <script>
        /*
            节点操作数量        运行时间
            3000                120
            2001                100
            1002                5
            3                   1

        */
        console.time('a')
        const $num = document.querySelector('.num')
        let num = $num.innerText
        for(let i=0;i<1000;i++){
            num++
        }
        $num.innerText = num;
        console.timeEnd('a')
    </script>
</body>
</html>